// MyArrayList
// auteur: J.Kaldeway
/*
public class MyArrayList<E>
{
    private E[] a_  = (E[])new Object[8];
    
    private int size_ = 0;
    
    private void addLast(E e)
    {
        if (size_ == a_.length)
        {
            E[] ha = (E[])new Object[a_.length*2];
            System.arraycopy(a_,0,ha,0,a_.length);
            a_ = ha;
        }    
        a_[size_] = e;
        size_++;            
    }
        
    private void delete(E e)
    {
        int i = 0;
        while (i < size_ && !a_[i].equals(e))
        	i++;
        if (i < size_) size_--;
        while (i < size_)
        {        
            a_[i] = a_[i+1];
            i++;
        }
        if (size_ >= 4 && size_ == a_.length/4)
        {
            E[] ha = (E[])new Object[a_.length/2];
            System.arraycopy(a_,0,ha,0,size_);
        	a_ = ha;
        }
    }        

    @Override
	public String toString()
    {
        String s = "";
        
        if (size_ > 0)
        {    s = s + a_[0].toString();
             for(int i = 1; i < size_; i++) 
        	     s = s + "," + a_[i].toString();
             for(int i = size_; i < a_.length; i++)
          	     s = s + ",x";
        }
        else
        {
        	s = "x";
            for(int i = 1; i < a_.length; i++)
          	     s = s + ",x";
        }	
        return s;
    }
    
    public static void main(String[] s)
    {
        MyArrayList<Integer> list = new MyArrayList<Integer>();
        System.out.println(list);
        
        for(int i = 1; i <= 6; i++)
          list.addLast(i);    
        System.out.println(list);
        
        list.addLast(7);
        list.addLast(8);
        System.out.println(list);

        list.addLast(9);
        System.out.println(list);
        
        for(int i = 10; i <= 16; i++)
          list.addLast(i);    
        System.out.println(list);
        

        for(int i = 1; i <= 11; i++)
          list.delete(i);    
        System.out.println(list);
        
        list.delete(12);
        System.out.println(list);
    }
}

*/